<%+header%>                                                                    
<div class="logscontainers">
	<form >
    <div class="logs">
        <button type="button" class="creatLogsLocal">生成日志到本地</button>
        <button type="submit" name="click" class="creatBackups" value="1">生成备份</button>
    </div>
	</form>
</div>
<script>
    /*$('.creatBackups').on('click',function () {
        registPost();
        event.preventDefault();
    });

    function registPost () {
        $.ajax({
            type: "post",
			timeout: 1200000,
            url: "<%=REQUEST_URI%>",
			contentType: "application/x-www-form-urlencoded",
            data: "click=1"
        }).success(function(message) {
            console.log(message);
			//window.location.reload();
        }).fail(function(err){
            console.log(err);
        })
    }*/
    var updater = {
        poll: function() {
            $.ajax({ 
				url: "<%=REQUEST_URI%>",
                type: "POST",
                dataType: "json",
				data: "click=1",
                success: updater.onSuccess,
                error: updater.onError
            });
        },
        onSuccess: function(data, dataStatus) {
            try {
                console.log(11);
            }
            catch (e) {
                updater.onError();
                return;
            }
            interval = window.setTimeout(updater.poll, 0);
        },
        onError: function() {
            console.log("Poll error;");
        }
    };

	$('.creatBackups').on('click',function () {
        updater.poll();
        
    });
    

</script>
</script>
<%+footer%>